<?php
class Action extends CAction {
    protected function loginRequired(){
        if(Yii::app()->user->isGuest)
            Yii::app()->user->loginRequired();
    }
}